package com.xyb.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder

@Document("course_comment")
public class CourseComment {
    private interface insert{};
    //评论id
    @Id
    private Long commentId;

    private Long courseId;
    private Long userId;

    private UserInfo userInfo;      //回复人信息

    private UserInfo toUserInfo;    //回复谁

    private String content;         //评论内容

    private int likeNum;            //喜欢数
    private int unlikeNum;          //不喜欢数

    private int status;
    private LocalDateTime createdDateTime;

    private Long parentId;          //父级id

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    public static class UserInfo {
        private Long userId;
        private String nickName;
        private String headPortraitUrl;
    }
}
